package sctu.edu.java.year2016.team05.lizixin.day20160523.chapter6_2;

/**
 * Created by home on 2016/5/23.
 * 试着只利用for循环和if条件句实现去除空格。
 */
public class kong {
    public static void main(String[] args) {
        String a=new String("abc def ghi");
        int t=a.indexOf(" ");
        String[] S=a.split(" ");
        for( int i=0;i<S.length;i++){
            if(t!=0)
                System.out.print(S[i]);
            else
                i++;
        }

    }
}
